﻿using AiFrame.InterfaceLib.Data.Provider;

namespace AiFrame.Base.Core.MVP
{
    /// <summary>
    /// Represents the login view.
    /// </summary>
    public interface ILoginView: IStartupView
    {
        /// <summary>
        /// Shows or hides the options area.
        /// </summary>
        /// <param name="show">If true, the options area is shown.</param>
        void ShowOptions(bool show);

        /// <summary>
        /// Specifies if the options area is shown or hidden.
        /// </summary>
        /// <returns>True, if the options area is shown.</returns>
        bool AreOptionsDisplayed();

        /// <summary>
        /// Gets or sets the username.
        /// </summary>
        string Username { get; set; }

        /// <summary>
        /// Gets or sets the host address.
        /// </summary>
        string HostAddress { get; set; }

        /// <summary>
        /// Gets or sets the password.
        /// </summary>
        string Password { get; set; }

        /// <summary>
        /// Adds a database provider to the view.
        /// </summary>
        /// <param name="dbProvider">The database provider.</param>
        void AddDbProvider(IDbProvider dbProvider);

        /// <summary>
        /// Returns the selected database provider.
        /// </summary>
        /// <returns>The provider.</returns>
        IDbProvider SelectedProvider { get;}

        /// <summary>
        /// Removes all providers from the view.
        /// </summary>
        void ClearAllProviders();

        /// <summary>
        /// Gets or sets the index of the selected
        /// database provider.
        /// </summary>
        int SelectedProviderIndex { get; set; }        

        /// <summary>
        /// Activates or deactivates an animation to imply
        /// a connnection request activity
        /// </summary>
        bool ShowConnectAnimation { set; }

        /// <summary>
        /// Focusses the password field.
        /// </summary>
        void FocusPasswordField();

        /// <summary>
        /// Specifies if the username field is enabled.
        /// </summary>
        bool UserNameFieldEnabled { set; }

        /// <summary>
        /// Specifies if the password field is enabled.
        /// </summary>
        bool PasswordFieldEnabled { set; }

        /// <summary>
        /// Specifies if the field for the host address is enabled.
        /// </summary>
        bool HostAddressFieldEnabled { set; }

        /// <summary>
        /// Specifies if the field for the database provider
        /// is enabled.
        /// </summary>
        bool DBProdiverFieldEnabled { set; }

        /// <summary>
        /// Starts a dialog for the user to chose
        /// the license file.
        /// </summary>
        /// <returns></returns>
        string SelectLicenseFile();
    }
}